import React from 'react';
import LayersOutlined from '@material-ui/icons/LayersOutlined';
import { NavView, get_mod, loc, NavListSub } from 'sui';
import { AwayView } from './view';
import { PairView } from './pair';

const model = (cfg) => {
    const fix = [
        {uid: "away.psn", view: AwayView,  value: loc("l_818")},
        {uid: "away.pair", view: PairView, value: loc("l_822")},
    ];

    return get_mod(cfg, fix, "away");
};

const Away = ({ mod, sideopen, cfg }) => <NavView cfg={cfg} model={model(cfg)} mod={mod} sideopen={sideopen} name="away"/>;

const NavAway = (props) => <NavListSub icon={<LayersOutlined/>} sub={model(props.cfg)} {...props} scut={15}/>;

export {NavAway, Away};
